<fieldset>
    <legend>条件搜索</legend>
    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">店铺名称</label>
            <label class="layui-input-inline">
                <select name='shop_id' class="layui-input">
                    <option value="0">请选择店铺</option>
                    {volist name="distributor" id="v"}
                       <option value="{$key}" {if  $key== input('get.shop_id')} selected {/if}>{$v}</option>
                    {/volist}
                    
                </select>
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">性别</label>
            <label class="layui-input-inline">
                <select name='sex' class="layui-input">
                    <option value="0">请选择性别</option>
                    <option value="1" {if input('get.sex')==1}selected{/if}>男</option>
                    <option value="2" {if input('get.sex')==2}selected{/if}>女</option>
                </select>

            </label>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">是否处于白名单</label>
            <label class="layui-input-inline">
                <select name='status' class="layui-input">
                    <option value="0" {if input('get.status')==0}selected{/if}>否</option>
                    <option value="1" {if input('get.status')==1}selected{/if}>是</option>
                </select>

            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">年龄</label>
            <label class="layui-input-inline">
                <input name="age" value="{:input('get.age')}" placeholder="请输入年龄" class="layui-input">
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">进店时间</label>
            <div class="layui-input-inline">
                <input data-date-range name="enter_time" value="{:input('get.enter_time')}" placeholder="请选择进店时间" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">离店时间</label>
            <div class="layui-input-inline">
                <input data-date-range name="leave_time" value="{:input('get.leave_time')}" placeholder="请选择离店时间" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
            <button type="button" data-form-export="{:url('admin/store_in_out_log/index')}?type={$type|default=''}" class="layui-btn layui-btn-primary">
                <i class="layui-icon layui-icon-export"></i> 导 出
        </button>
        </div>
    </form>
</fieldset>

<script>form.render()</script>
<script>
    window.form.render();
    require(['excel'], function (excel) {
        excel.bind(function (data) {
            data.forEach(function (item, index) {
                data[index] = [item.id, item.face_id, item.enter_time, item.leave_time, item.stay_time, item.age, item.sex,item.equipment_id,item.name];
            });
            data.unshift(['ID', 'FaceId', '进店时间', '离开时间', '停留时间(s)', '年龄', '性别','摄像机','店铺']);
            return data;
        }, '进出店记录');
    });
</script>
